<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>招聘录用</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<style type="text/css">
	#hire{
		width: 100%;
		margin:auto;
	    overflow-x: auto;
	    margin-top: 5px;
	    border-collapse: collapse;
	    border: 1px solid #e4e7ec;
	    background-color: #fff;
   		color: gray;
   		font-size:12px; 
	}
	#hire thead{
		color: #19AA8D;
	    font-size: 14px;
	    font-weight: 700;
	} 
	#hire th{
		background: #6666661a;
	}
	#hire td{
		border: 1px solid #e4e7ec;
		width: 150px;
		height: 50px;
	}
.datagrid-header-row td{
		background: #E6E6E6;
		color: #19AA9C;
	    font-size: 14px;
	    font-weight: 700;
	    text-align: center;
	}
	.datagrid-row td{
		background: #fff;
		font-size: 12px;
		text-align: center;
	}
.frhsz,.looks{
		color:white;
		cursor: pointer;
		border:none;
}
.icon-hire-fasong{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/fasong.png') no-repeat 5% 50%;
		background-color:#FF0000;
}
.icon-hire-chakan{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/chakan.png') no-repeat 5% 50%;
		background-color:#1AB394;
}

	ul li{
	list-style:none;
}
#testconpanylooks{
	width:620px;
	height:260px;
	border:solid 1px #DADADA;
	margin:auto;
}
.insertcontents{
	width:600px;
	height:180px;
	margin-top:10px;
}
.insert-left{
	width:210px;
	height:180px;
	float:left;
	margin-left:40px;
}
.insert-right{
	width:240px;
	height:180px;
	float:right;
	margin-right:20px;
}
#creater{
	margin-left:12px;
}
#interviews{
	margin-left:-12px;
}
#id,#name,#age,#sex,#study,#email,#phone,#position,#adress,#mark,#times,#statue{
	width:170px;
	margin-bottom: 10px;
}
.finally-anniu{
	margin-right:10px;
	width:100px;
	height:30px;
	margin-top:30px;
	float:right;
}
#hireclose{
	width:60px;
	background-color:#17AA8D;
	cursor: pointer;
	color:white;
}
#wheathhire{
		width:400px;
		height:100px;
		margin:auto;
}
.askhire{	
		width:400px;
		height:30px;
		margin:auto;
		text-align:center;
		color:#1AB394;
		font-size:15px;
		line-height:30px;
}
.answerhire{
		width:180px;
		height:30px;
		margin:20px auto;
}
#hireanno,#hireanyes{
		width:60px;
		height:25px;
		cursor: pointer;
		margin-left: 20px;
		background-color:#1AB394;
		color:white;
		border:none;
}
.table-center{
	width:1000px;
	margin:10px auto;
}
.checkhire{
	width:300px;
	height:30px;
	margin-left:90px;
	margin-top:10px;
}
</style>
<script type="text/javascript">
	function found(){	
		$("#hire").datagrid({
		    url:'select-offer',
		    columns:[[
		    	{field:'aa',checkbox:true,title:'选择',width:100},
		    	{field:'rofferid',hidden:true,title:'编号',width:200}, 
		    	{field:'reasyid',title:'简历id',width:340,hidden:true},
		    	{field:'hirexh',title:'序号',width:220},
		    	{field:'reasyguidang',title:'归档状态',width:120,hidden:true},
		    	{field:'reasyname',title:'面试人',width:340},
		    	{field:'caozuo',title:'操作',width:410,align:'center',
					formatter: function(value,row,index){
						if(row["reasyguidang"]==0){
							return "<input type='button' class='looks icon-hire-chakan' onclick='xiang("+row.reasyid+")' style='width:80px;height: 20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='查看详情'/>"+
							"<input type='button'  onclick='fasong("+row["reasyid"]+")' class='frhsz icon-hire-fasong' style='width:120px;height: 20px;margin-left:20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='发送到人事部'/>";
						}else if(row["reasyguidang"]==1){
							return "<input type='button' class='looks icon-hire-chakan' onclick='xiang("+row.reasyid+")' style='width:80px;height: 20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='查看详情'/>";
						}
					}
				}
		    	]],		          
		         	pagination:true,
				    pageNumber:1,
				    pageSize:5,
				    pageList:[5,10,15]
		    });
	};
	function chaxun(value,name){
		$("#hire").datagrid({
	    queryParams:{
	    	reasyname:value		  
	    },
	    	url:'select-name',
	    	columns:[[
		    	{field:'aa',checkbox:true,title:'选择',width:100},
		    	{field:'rofferid',hidden:true,title:'编号',width:200}, 
		    	{field:'reasyid',title:'简历id',width:340,hidden:true},
		    	{field:'hirexh',title:'序号',width:220},
		    	{field:'reasyname',title:'面试人',width:340},
		    	{field:'caozuo',title:'操作',width:410,align:'center',
					formatter: function(value,row,index){
						return "<input type='button' class='looks icon-hire-chakan' onclick='xiang("+row.riviewid+","+row.reasyid+")' style='width:80px;height: 20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='查看详情'/>"+
						"<input type='button' onclick='fasong("+row["reasyid"]+")' class='frhsz icon-hire-fasong' style='width:120px;height: 20px;margin-left:20px;font-size:12px;border-radius:4px;color:#fff;background-color:#18A689;cursor: pointer;' value='发送到人事部'/>";
					},
				}
		    	]],
		    	pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15] 
		});
	}
	$(function(){
		found(null);
});
	//搜索
	function checkoffers(value,name){ 
		chaxun(value,name);
		}   
	//遮罩层隐藏
	$("#zhezhao").hide();
	//查看详情
	function  xiang(reasyid){
		$("#id").val("");
		$("#name").val("");
		$("#age").val("");
		$("#sex").val("");
		$("#study").val("");
		$("#eamil").val("");
		$("#phone").val("");
		$("#position").val("");
		$("#times").val("");
		$("#adress").val("");
		$("#statue").val("");
		$("#mark").val("");
		
		$("#hirelooks").window("open");
		//显示遮罩层
		  $("#zhezhao").show();
		
		$.ajax({
					url:"hire-xiangq",
					type:"post",
					data:{
						"reasyid":reasyid
					},
					//从数据库获取简历数据
					success:function(data){
						$("#id").val(data[0]["reasyid"]);
						$("#name").val(data[0]["reasyname"]);
						$("#age").val(data[0]["reasyage"]);
						$("#sex").val(data[0]["reasysex"]);
						$("#study").val(data[0]["reasyacademic"]);
						$("#email").val(data[0]["reasyemail"]);
						$("#phone").val(data[0]["reasyphone"]);
						$("#position").val(data[0]["position_name"]);
						$("#times").val(data[0]["reasytime"]);
						$("#adress").val(data[0]["reasyadress"]);
						$("#statue").val(data[0]["reasystatue"]);
						$("#mark").val(data[0]["reasyremark"]);
					}
		});
	}
	//点击关闭按钮
   $("#hireclose").click(function(){
	   $("#hirelooks").window("close");
	   $("#zhezhao").hide();
   }); 
	
 //点击发送按钮弹框
	function fasong (value){
		 $.ajax({
			 type:"post",
			  url:"fasong-staff",
			  data:{"id":value},
			  success:function(res){
				  found();
				alert("已发送到人事部 ");
			  }
		});	  
	} 
	 //关闭查看详情界面
	   $(document).ready(function(){		    
		   $('#hirelooks').window({
		       onBeforeClose:function(){ 
		    	   $("#zhezhao").hide();
		       }
		   });

		});
</script>
	<div class="hire">
		<div class="checkhire">
			<input class="easyui-searchbox" style="width:200px" data-options="searcher:checkoffers,prompt:'请输入面试人'"></input>
		</div>
		<div class="table-center">
			<table id="hire" class="easyui-datagrid" data-options="width:1000,height:300"></table>
		</div>
</div>

<!-- 查看详情界面 -->
<div id="zhezhao" style="width:1366px;height:736px;position:fixed; top:0px;
background: rgba(0, 0, 0, 0.5);text-align:center;left:0;z-index:10;display:none;" >
<div id="hirelooks" class="easyui-window" title="录用人简历" data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">	
		<div class="insertcontents">
		<div class="insert-left">
			<form id="left" method="post">
				<span>编号：</span><input type="text" id="id" name="reasyid" value="${pojos.reasyid }">
				<span>姓名：</span><input type="text" id="name" name="reasyname" value="${pojos.reasyname }">
				<span>年龄：</span><input type="text" id="age" name="reasyage" value="${pojos.reasyage }">
				<span>性别：</span><input type="text" id="sex" name="reasysex" value="${pojos.reasysex }">
				<span>学历：</span><input type="text" id="study" name="reasyacademic" value="${pojos.reasyacademic }">
				<span>备注：</span><input type="text" id="mark" name="reasyremark" value="${pojos.reasyremark }">
			</form>
		</div>
		<div class="insert-right">
			<form id="right" method="post">
				<span>家庭住址：</span><input type="text" id="adress" name="reasyadress" value="${pojos.reasyadress }">
				<span>手机号码：</span><input type="text" id="phone" name="reasyphone" value="${pojos.reasyphone }">
				<span>应聘职位：</span><input type="text" id="position" name="postion_name" value="${pojos.postion_name }">
				<span>电子邮箱：</span><input type="text" id="email" name="reasyemail" value="${pojos.reasyemail }">
				<span>面试时间：</span><input type="text" id="times" name="riviewtime" value="${pojos.riviewtime }">
				<span>简历状态：</span><input type="text" id="statue" name="reasystatue" value="${pojos.reasystatue }">
			</form>
		</div>
	</div>
	<div class="finally-anniu"><button id="hireclose">关闭</button></div>
</div>
</div>
</body>
</html>